cmake_minimum_required(VERSION 3.10)
project(tcp--udptest C)

# 设置C标准
set(CMAKE_C_STANDARD 11)

# tcp可执行文件
add_executable(tcpserver src/tcp/TCPserver.c src/tcp/common.c)
add_executable(tcpclient src/tcp/TCPclient.c src/tcp/common.c)

# udp可执行文件
add_executable(udpserver src/udp/UDPserver.c src/udp/common.c)
add_executable(udpclient src/udp/UDPclient.c src/udp/common.c)

include_directories(src)  # 添加包含目录

# 链接线程库
target_link_libraries(tcpserver pthread)
target_link_libraries(tcpclient pthread)
target_link_libraries(udpserver pthread)
target_link_libraries(udpclient pthread)
# ##################################
# # day1可执行文件
# add_executable(day1 src/day1/day1.c)
# # day2可执行文件
# add_executable(day2-getchar src/day2/day2-getchar.c)
# add_executable(day2-if1 src/day2/day2-if1.c)
# add_executable(day2-if2 src/day2/day2-if2.c)
# add_executable(day2-for1 src/day2/day2-for1.c)
# add_executable(day2-for2 src/day2/day2-for2.c)
# add_executable(day2-switch src/day2/day2-switch.c)
# add_executable(day2-work3 src/day2/day2-work3.c)
# target_link_libraries(day2-work3 m)
# add_executable(day2-work4 src/day2/day2-work4.c)
# # day3可执行文件
# add_executable(day3-for1 src/day3/day3-for1.c)
# add_executable(day3-for2 src/day3/day3-for2.c)
# add_executable(day3-while src/day3/day3-while.c)
# add_executable(day3-work src/day3/day3-work.c)
# target_link_libraries(day3-for1 m)

# # day4可执行文件
# add_executable(day4-yiwei1 src/day4/day4-yiwei1.c)
# add_executable(day4-yiwei2 src/day4/day4-yiwei2.c)
# add_executable(day4-yiwei3 src/day4/day4-yiwei3.c)
# add_executable(day4-erwei1 src/day4/day4-erwei1.c)
# add_executable(day4-erwei2 src/day4/day4-erwei2.c)
# add_executable(day4-zhizhen1 src/day4/day4-zhizhen1.c)
# add_executable(day4-zhizhen2 src/day4/day4-zhizhen2.c)
# add_executable(day4-zhizhen3 src/day4/day4-zhizhen3.c)
# target_link_libraries(day4-zhizhen3 m)
# add_executable(day4-work2 src/day4/day4-work2.c)
# add_executable(day4-work3 src/day4/day4-work3.c)
# add_executable(day4-work4 src/day4/day4-work4.c)
# add_executable(day4-work5 src/day4/day4-work5.c)

# # day6可执行文件
# add_executable(day6-work src/day6/day6-work.c)

# # day7可执行文件
# add_executable(day7-work1 src/day7/day7-work1.c)
# add_executable(day7-work2 src/day7/day7-work2.c)
# add_executable(day7-work3 src/day7/day7-work3.c)

# # day8可执行文件
# add_executable(day8-work src/day8/day8-work.c)
#############################